package org.example.listener;
import lombok.extern.slf4j.Slf4j;
import org.example.common.configs.queue.disruptor.StatEnableEventHandler;
import org.example.listener.event.CurvePlanChangedEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author weigang
 * @create 2022-07-11 15:11
 */
@Component
@Slf4j
public class CurvePlanChangedEventListener {

    @Autowired
    private StatEnableEventHandler statEnableEventHandler;

    @EventListener
    public void handleCurvePlanChanged(CurvePlanChangedEvent event) {
        statEnableEventHandler.doHandle(this::doHandle, event);
    }


    private void doHandle(CurvePlanChangedEvent event) {
        // 消费数据
        System.out.println(event.getContent());
    }


}
